package com.whh.nlp.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.whh.nlp.mapper.DapeiMapper;
import com.whh.nlp.pojo.Dapei;
import com.whh.nlp.pojo.DapeiCount;
import com.whh.nlp.service.DapeiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DapeiServiceImpl implements DapeiService {

    @Autowired
    DapeiMapper dapeiMapper;

    @Override
    public PageInfo<Dapei> getDapei(Integer page, String str) {
        PageHelper.startPage(page, 15);
        List<Dapei> dapeiList = dapeiMapper.getDapei(str);
        PageInfo<Dapei> dapeiPageInfo = new PageInfo<>(dapeiList);
        return dapeiPageInfo;
    }

    @Override
    public List<DapeiCount> getDapeiCountList() {
        return dapeiMapper.getDapeiCount();
    }
}
